/**
 * 
 */
package com.sasis.dao.ibatis;

import java.io.Serializable;
import java.util.List;

import org.springframework.orm.ObjectRetrievalFailureException;

import com.sasis.dao.FlightTransferInfoDao;
import com.sasis.model.FlightTransferHotel;
import com.sasis.model.FlightTransferInfo;
import com.sasis.model.FlightTransferProtect;
import com.sasis.util.PageList;
import com.sasis.util.PageRequest;

/**
 * @author wujx
 *
 */
public class FlightTransferInfoDaoiBatis extends BaseDaoiBATIS implements FlightTransferInfoDao {

	/* (non-Javadoc)
	 * @see com.sasis.dao.FlightTransferInfoDao#getFlightTransferInfo(java.lang.Integer)
	 */
	public FlightTransferInfo getFlightTransferInfo(Integer id) {
		// TODO Auto-generated method stub
		return  (FlightTransferInfo)getSqlMapClientTemplate().queryForObject("getFlightTransferInfo", id);
	
	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.FlightTransferInfoDao#getFlightTransferInfos(com.sasis.model.FlightTransferInfo)
	 */
	public List getFlightTransferInfos(FlightTransferInfo flightTransferInfo) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().queryForList("getFlightTransferInfos", flightTransferInfo);
	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.FlightTransferInfoDao#removeFlightTransferInfo(com.sasis.model.FlightTransferInfo)
	 */
	public void removeFlightTransferInfo(FlightTransferInfo flightTransferInfo) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.FlightTransferInfoDao#saveFlightTransferInfo(com.sasis.model.FlightTransferInfo)
	 */
	public int saveFlightTransferInfo(FlightTransferInfo flightTransferInfo) {
        Integer id = flightTransferInfo.getId();
        // check for new record
        if (id == null) {
        	throw new ObjectRetrievalFailureException(FlightTransferInfo.class, id);
        } else {
            getSqlMapClientTemplate().update("updateFlightTransferInfo", flightTransferInfo);
        }
        return id.intValue();
	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.Dao#getObject(java.lang.Class, java.io.Serializable)
	 */
	public Object getObject(Class clazz, Serializable id) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.Dao#getObjects(java.lang.Class)
	 */
	public List getObjects(Class clazz) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.Dao#removeObject(java.lang.Class, java.io.Serializable)
	 */
	public void removeObject(Class clazz, Serializable id) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.Dao#saveObject(java.lang.Object)
	 */
	public void saveObject(Object o) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.sasis.dao.FlightTransferInfoDao#getDynamicFlightTransferInfo(java.lang.Integer)
	 */
	public FlightTransferInfo getDynamicFlightTransferInfo(FlightTransferInfo flightTransferInfo) {
		List aaa = getSqlMapClientTemplate().queryForList("getDynamicFlightTransferInfo", flightTransferInfo);
		System.out.println(aaa);
		 return  (FlightTransferInfo)aaa.get(0);
	}

}
